-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix!: Pass url struct tags by value instead of by reference
#3991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Glenn Lewis <[email protected]>
Signed-off-by: Glenn Lewis <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3991 +/- ##
=======================================
Coverage 93.52% 93.52%
=======================================
Files 207 207
Lines 17590 17590
=======================================
Hits 16451 16451
Misses 938 938
Partials 201 201 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Glenn Lewis <[email protected]>
|
If any of you have time to review, that would be greatly appreciated. cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra |
|
Also, should we update all the struct in this PR? I believe a lot of struct need to be change |
In this PR, I updated the ones that I know are "safe" - all the pagination ones, etc. I left the others for later review on a one-by-one basis. |
Signed-off-by: Glenn Lewis <[email protected]>
|
Thank you, @Not-Dhananjay-Mishra and @alexandear, for the great review feedback! |
|
Oh! And here's one other idea I had for the Thoughts? |
Great idea. Let's add it to |
Signed-off-by: Glenn Lewis <[email protected]>
OK, I've incorporated it and pushed the change... amazing that the change was trivial... the comments were more difficult to write. 😂 Here is an example run to show that it is working: Now I'm wondering if might be confusing to end-users? |
I think we should tell the end users that script has done some changes in |
Signed-off-by: Glenn Lewis <[email protected]>
OK, I thought I saw something wrong, but I think this is what we are ending up with: I saw that "Removed" for the |
If we can't avoid that, I think then it's fine to remove that print statement 🙃 |
Signed-off-by: Glenn Lewis <[email protected]>
OK, then |
Not-Dhananjay-Mishra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thank you, @alexandear and @Not-Dhananjay-Mishra! |
BREAKING CHANGE: Many
*Optionsstructs now passomitemptyURL struct fields by value instead of by reference.Fixes: #3990.
Relates to: #3984.
Over time, I had allowed and even encouraged pointers to primitive types to be used in the URL struct tags when "omitempty" was provided. This violates the spirit of the purpose of the use of pointers for GitHub resource types as declared in this repo's README.md, and this is the first step to getting back on track to a self-consistent client library.
I apologize for the breakages that this PR causes and for all the contributors whom I wrongly steered during code reviews.
Note that timestamps can still be passed by reference (or by value if using
omitzero).Also note that a new
check-structfield-settingstool is added to this repo that will report (and optionally-fix) any obsolete exceptions listed in the.golangci.ymlfile at the root of the repo.